#define _CRT_SECURE_NO_WARNINGS 1
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e6 + 4;
const int p = 1e9 + 7;
ll a[N], pre[N];
void solve()
{
    int n;cin >> n;
    for (int i = 1;i <= n;++i)cin >> a[i];

    for (int i = 1;i <= n;++i)pre[i] = pre[i - 1] ^ a[i];

    ll ans = 1;
    for (int i = 1;i <= n;++i)
        for (int j = i;j <= n;++j)
        {
            ll t = pre[i - 1] ^ pre[j];
            if (!t)
            {
                cout << 0;
                return;
            }
            ans = ans * (t);
        }

    cout << ans % p;


}


int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int t = 1;
    //cin >> t;
    while (t--)
    {
        solve();
    }

    return 0;
}